﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RenAi.Medical.BLL;

namespace RenAi.Medical.Admin
{
    public partial class yisheng : System.Web.UI.Page
    {
        DocBll bll = new DocBll();
        public void LoadData()
        {
            this.Repeater1.DataSource = bll.GetDocAll();
            this.Repeater1.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadData();
            }
        }

        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string ename = e.CommandName; //获取您当前要执行命令名称
            string Doctor_Id = e.CommandArgument.ToString();  //获取当前绑定的主键值

            switch (ename)
            {
                case "Del":
                    if (bll.DelDoc(Doctor_Id) > 0)
                    {
                        Response.Write("<script>alert('删除成功!');</script>");
                        LoadData();
                    }
                    break;
                case "Upt":
                    Response.Redirect("UpdateDoxtor.aspx?id=" + Doctor_Id);
                    break;
            }
        }
    }
}